from itertools import combinations

class Solution:
    def combinationSum3(self, k: int, n: int) -> 'List[List[int]]':
        return [nums for nums in combinations(range(1, 10), k) if sum(nums) == n]

if __name__ == "__main__":
    s = Solution()
    print(s.combinationSum3(3, 7))
    print(s.combinationSum3(3, 9))